package com.z.javabean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component // 标记为 Spring 管理的 Bean
public class User {
    @Value("1001") // 直接注入属性值
    private int id;

    @Value("张三")
    private String name;

    @Value("25")
    private int age;
    @Value("张三")
    public void setName(String name) {
        this.name = name;
    }

    // Getter & Setter
    // toString()
}
